﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace BBMS.DLL.Base
{
    public class FilterParams
    {
        public int TotalPage = 1;
        public int CurrentPage = 0;

        public ArrayList ArParams = new ArrayList();

        public FilterParams() {}

        public string SQLString
        {
            get
            {
                string retVal = "";
                for (int i = 0; i < ArParams.Count; i ++ )
                {
                    if (i > 0) retVal += " AND ";
                    retVal += ((FilterCondition)ArParams[i]).SQLString;
                }
                return retVal;
            }
        }
        /*public MySql.Data.MySqlClient.MySqlParameterCollection SQLParams
        {
            get
            {
                MySql.Data.MySqlClient.MySqlParameterCollection retVal = new MySql.Data.MySqlClient.MySqlParameterCollection();
                for (int i = 0; i < ArParams.Count; i++)
                    retVal.Add("@" + ((FilterCondition)ArParams[i]).FieldName, ((FilterCondition)ArParams[i]).Value);
                
                return retVal;
            }
        }*/
    }
}
